package com.canplay.screen.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.canplay.screen.ui.view.MainActivity

class BootReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent?.action == Intent.ACTION_BOOT_COMPLETED) {
            // 在这里启动您的应用程序的主 Activity 或执行任何其他必要的操作
            val launchIntent = Intent(context, MainActivity::class.java)
            launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context?.startActivity(launchIntent)
        }
    }
}